package com.ly.heart.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.ly.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ly.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * 销售订单交货明细对象 erp_sale_order_delivery
 *
 * @author wutao
 * @date 2024-06-30
 */
@TableName("erp_sale_order_delivery")
@ApiModel(value = "erp_sale_order_delivery对象", description = "销售订单交货明细")
@Data
public class SaleOrderDeliveryEntity extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 交货明细主键id
     */
    @TableId(type = IdType.INPUT)
    private String id;

    /**
     * 订单id
     */
    @ApiModelProperty("订单id")
    @TableField("order_id")
    @Excel(name = "订单id")
    private String orderId;

    /**
     * 物料编码
     */
    @ApiModelProperty("物料编码")
    @TableField("material_code")
    @Excel(name = "物料编码")
    private String materialCode;

    /**
     * 物料名称
     */
    @ApiModelProperty("物料名称 ")
    @TableField("material_name")
    @Excel(name = "物料名称 ")
    private String materialName;

    /**
     * 库存组织（就是登录的所属公司）
     */
    @TableField("inventory_dept")
    @ApiModelProperty("库存组织")
    @Excel(name = "库存组织", readConverterExp = "就=是登录的所属公司")
    private String inventoryDept;

    /**
     * 发货上限
     */
    @ApiModelProperty("发货上限")
    @TableField("delivery_up")
    @Excel(name = "发货上限")
    private String deliveryUp;

    /**
     * 发货下限
     */
    @ApiModelProperty("发货下限")
    @TableField("delivery_down")
    @Excel(name = "发货下限")
    private String deliveryDown;

    /**
     * 超发控制单位类型0销售单位，1库存单位
     */
    @ApiModelProperty("超发控制单位类型0销售单位，1库存单位")
    @TableField("delivery_type")
    @Excel(name = "超发控制单位类型0销售单位，1库存单位")
    private String deliveryType;

    /**
     * 超发控制单位
     */
    @ApiModelProperty("超发控制单位")
    @TableField("delivery_unit")
    @Excel(name = "超发控制单位")
    private String deliveryUnit;

    /**
     * 是否使用
     */
    @ApiModelProperty("是否使用")
    @TableField("is_used")
    @TableLogic
    @Excel(name = "是否使用")
    private Integer isUsed;

    @ApiModelProperty("销售交货计划明细列表")
    @TableField(exist = false)
    private List<SaleOrderDeliveryDetailEntity> saleOrderDeliveryDetailEntities;


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }

    public String getMaterialCode() {
        return materialCode;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setInventoryDept(String inventoryDept) {
        this.inventoryDept = inventoryDept;
    }

    public String getInventoryDept() {
        return inventoryDept;
    }

    public void setDeliveryUp(String deliveryUp) {
        this.deliveryUp = deliveryUp;
    }

    public String getDeliveryUp() {
        return deliveryUp;
    }

    public void setDeliveryDown(String deliveryDown) {
        this.deliveryDown = deliveryDown;
    }

    public String getDeliveryDown() {
        return deliveryDown;
    }

    public void setDeliveryType(String deliveryType) {
        this.deliveryType = deliveryType;
    }

    public String getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryUnit(String deliveryUnit) {
        this.deliveryUnit = deliveryUnit;
    }

    public String getDeliveryUnit() {
        return deliveryUnit;
    }

    public void setIsUsed(Integer isUsed) {
        this.isUsed = isUsed;
    }

    public Integer getIsUsed() {
        return isUsed;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("orderId", getOrderId())
                .append("materialCode", getMaterialCode())
                .append("materialName", getMaterialName())
                .append("inventoryDept", getInventoryDept())
                .append("deliveryUp", getDeliveryUp())
                .append("deliveryDown", getDeliveryDown())
                .append("deliveryType", getDeliveryType())
                .append("deliveryUnit", getDeliveryUnit())
                .append("isUsed", getIsUsed())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
